import React from 'react'
import { useParams } from 'react-router-dom'
import { useHistory } from 'react-router-dom/cjs/react-router-dom.min'

export const Student = (props) => {
    // console.log(props)
    // 使用react提供的钩子函数获取属性
    // const match = useRouteMatch()
    // const location = useLocation()
    const history = useHistory()
    const {id} = useParams()
    console.log(id)
    const btnHandle = () => {
        history.push({
            pathname: '/about',
            state: {
                title: '请在About页进行打印',
                desc: '我是学生页传过来的描述信息'
            }
        })
    }
  return (
    <div>
        {/* 

        */}
        <h1>
            这是学生页
        </h1>
        <button onClick={btnHandle}>点击跳转</button>
    </div>
  )
}
